package com.gitee.wsl.struct.tree.bean

import com.gitee.wsl.struct.generator.randomUUID


data class TreeNodeItem(var name:String,var attentionLevel:Int=0,var hot:Boolean=false){

    var childNodes = mutableListOf<TreeNodeItem>()

    fun addNodeItem(nodeItem: TreeNodeItem){
        childNodes.add(nodeItem)
    }

    fun removeNodeItem(nodeItem: TreeNodeItem){
        childNodes.remove(nodeItem)
    }

    fun size() = childNodes.size

    fun isLeaf():Boolean = size()==0

    fun isHot():Boolean = hot

}

data class TreeItem(var name:String,var id:String= randomUUID(),var root: TreeNodeItem= TreeNodeItem(name))
